home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / dllvers.frm < prev    next >
Text File  |  1995-05-07  |  2KB  |  84 lines

  1. VERSION 2.00
  2. Begin Form DLLVersionForm 
  3.    Caption         =   "DLLVersions"
  4.    ClientHeight    =   1815
  5.    ClientLeft      =   3135
  6.    ClientTop       =   1590
  7.    ClientWidth     =   2775
  8.    Height          =   2220
  9.    Left            =   3075
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form2"
  12.    ScaleHeight     =   1815
  13.    ScaleWidth      =   2775
  14.    Top             =   1245
  15.    Width           =   2895
  16.    Begin CommandButton OKButton 
  17.       Caption         =   "OK"
  18.       Height          =   375
  19.       Left            =   1080
  20.       TabIndex        =   0
  21.       Top             =   1320
  22.       Width           =   735
  23.    End
  24.    Begin Label Label3 
  25.       Alignment       =   2  'Center
  26.       Height          =   255
  27.       Left            =   120
  28.       TabIndex        =   3
  29.       Top             =   960
  30.       Width           =   2535
  31.    End
  32.    Begin Label Label2 
  33.       Alignment       =   2  'Center
  34.       Height          =   255
  35.       Left            =   120
  36.       TabIndex        =   2
  37.       Top             =   600
  38.       Width           =   2535
  39.    End
  40.    Begin Label Label1 
  41.       Alignment       =   2  'Center
  42.       Height          =   255
  43.       Left            =   120
  44.       TabIndex        =   1
  45.       Top             =   240
  46.       Width           =   2535
  47.    End
  48. End
  49.  
  50. Sub Form_Load ()
  51.     Label1.Caption = GetDLLVersion("NWNETAPI.DLL")
  52.     Label2.Caption = GetDLLVersion("NWIPXSPX.DLL")
  53.     Label3.Caption = GetDLLVersion("NWPSERV.DLL")
  54. End Sub
  55.  
  56. Function GetDLLVersion (DLLFileName$) As String
  57.     winDir$ = Environ$("windir")
  58.     DLLFile$ = winDir$ + "\" + DLLFileName$
  59.     fileFound$ = Dir$(DLLFile$)
  60.     If (Len(fileFound$) = 0) Then
  61.         GetDLLVersion = DLLFileName$ + " not found"
  62.     Else
  63.         Open DLLFile$ For Binary Access Read Shared As #1
  64.         Do While Not EOF(1)
  65.             buffer$ = Input$(8, #1)
  66.             If (buffer$ = "VeRsIoN=") Then
  67.                 Do
  68.                     char$ = Input$(1, #1)
  69.                     version$ = version$ + char$
  70.                 Loop While (char$ <> Chr$(0))
  71.                 GoTo Break
  72.             End If
  73.         Loop
  74. Break:
  75.         Close
  76.     End If
  77.     GetDLLVersion = version$
  78. End Function
  79.  
  80. Sub OKButton_Click ()
  81.     Unload DLLVersionForm
  82. End Sub
  83.  
  84.